
{%extends '../tpl/admin-base.html'%}
{%block body%}
<div class="main">
    {%include '../tpl/aside-nav.html'%}
    <div class="aside-content">
        {%if data%}

        <form action="/addArticle" method="post">
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">标题：</div>
                    <input type="text" name="title" value="{{data.title}}">
                </div>
            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">标签：</div><input type="text" name="tags" value="{{data.tags}}">
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">分类：</div><input type="text" name="type" value="{{data.type}}">
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">封面：</div>
                    <div class="img-choose">
                        <a href="javascript:;" class="button-normal button-light img-picker">选择封面图</a>
                        <div class="img-preview">
                            <img src="{{data.cover}}" alt="">
                        </div>
                        <input type="hidden" name="cover" value="{{data.cover}}">
                    </div>
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">摘要：</div>
                    <textarea  name="desc">{{data.desc}}</textarea>
                </div>
            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">详情：</div>
                    <textarea  name="detail" class="tiny">
                        {{data.detail}}
                    </textarea>
                </div>
            </div>
            <div class="form-row">
                <input type="hidden" name="id" value="{{data._id}}">
                <div class="form-cell">
                    <button class="button-dark button-normal save">提交</button>
                </div>
            </div>
        </form>
        {%else%}
        <form action="/addArticle" method="post">
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">标题：</div>
                    <input type="text" name="title">
                </div>
            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">标签：</div><input type="text" name="tags">
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">分类：</div><input type="text" name="type">
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">封面：</div>
                    <div class="img-choose">
                        <a href="javascript:;" class="button-normal button-light img-picker">选择封面图</a>
                        <div class="img-preview">

                        </div>
                        <input type="hidden" name="cover" value="">
                    </div>
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">摘要：</div>
                    <textarea  name="desc"></textarea>
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <div class="label">详情：</div>
                    <textarea  name="detail" class="tiny"></textarea>
                </div>

            </div>
            <div class="form-row">
                <div class="form-cell">
                    <button class="button-dark button-normal save">提交</button>
                </div>
            </div>
        </form>
        {%endif%}
    </div>
</div>

{%endblock%}






